<?php
declare (strict_types = 1);

namespace app\mini\model;

use think\Model;

/**
 * @mixin Model
 */
class MiniAdv extends Model
{
    //
    public function setPathAttr($value, $data)
    {
        if ($value) {
            $path = MiniPath::where('path', $value)->find();
            if ($path && ($type = $path->getData('type'))) {
                $this->set('type', $type);
            }
        }
        return $value;
    }
}
